import request from '@/utils/request';
import type { MenuList } from './type';

import type { Response } from '@/api/type';

enum API {
  //  根据职位获取权限列表
  GET_PERMISSION_LIST = '/admin/acl/permission/toAssign',

}

// 获取权限列表
export const reqGetPermissionList = (roleId: number) => {
  return request.get<any, Response<MenuList>>(`${API.GET_PERMISSION_LIST}/${roleId}`);
}
// 分配权限
export const reqAssign = (roleId: number, permissionId: number[]) => {
  return request.post<any, any>(`${API.GET_PERMISSION_LIST}/${roleId}`, permissionId);
}

